@extends('layout.admin')

@section('content')

<script type="text/javascript" charset="utf-8" src="/admins/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/admins/ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="/admins/ueditor/lang/zh-cn/zh-cn.js"></script>

<style>
  .color input,.size input{
   font-size: 14px;
   margin-left: 20px;

  }
</style>
	
	<div class="clearfix"></div>
 
	<div class="col-md-10 " >
@if (count($errors) > 0)
      <div class="alert alert-info">
              @foreach ($errors->all() as $error)
              <li>
                <img src="/admins/images/info.png" alt="">&nbsp;
                {{ $error }}</li>
              @endforeach
      </div>
  @endif
 

 <div class="panel-head"><strong class="icon-reorder"> 添加商品</strong></div>
  <form class="form-horizontal" role="form" action='/admin/goods/insert' method='post' enctype='multipart/form-data' style='margin-left:0px'> 
        <div class="form-group" style='margin-bottom:20px;margin-top:20px'>
          <label for="inputEmail3" class="col-sm-2 control-label">商品标题</label>
          <div class="col-sm-10">
              <input type="text" name='title' class="form-control" id="inputEmail3" placeholder="商品标题" value='{{old("title")}}'>
          </div>
        </div>
        
        <div class="form-group" style='margin-bottom:20px'>
          <label for="inputPassword3" class="col-sm-2 control-label">价&nbsp;&nbsp;  &nbsp;&nbsp; 格</label>
          <div class="col-sm-2">
              <input type="text" name='price' class="form-control" id="inputPassword3" placeholder="价格" value='{{old("price")}}'> 
          </div>
        </div>
        
        <div class="form-group" style='margin-bottom:20px'>
          <label for="inputPassword4" class="col-sm-2 control-label">库&nbsp;&nbsp;  &nbsp;&nbsp; 存</label>
          <div class="col-sm-10">
              <input type="text" name='kucun' class="form-control" id="inputPassword4" placeholder="库存" value='{{old("kucun")}}'>
          </div>
        </div>
        <div class="form-group" style='margin-bottom:20px'>
        <div class="col-sm-10 color">
            <label for="inputPassword4" class="col-sm-2 control-label">颜&nbsp;&nbsp;  &nbsp;&nbsp; 色</label>
            
                <input type="checkbox" name='color[]' value='红色'>红色
                <input type="checkbox" name='color[]' value='军绿色'>军绿色
                <input type="checkbox" name='color[]' value='黑色'>黑色
                <input type="checkbox" name='color[]' value='灰色'>灰色
                <input type="checkbox" name='color[]' value='白色'>白色
              
            </div>
        </div>
        <div class="form-group" style='margin-bottom:20px'>
          <div class="col-sm-10 size">
            <label for="inputPassword4" class="col-sm-2 control-label">尺&nbsp;&nbsp;  &nbsp;&nbsp; 码</label>
          
                <input type="checkbox" name='size[]' value='S'>S
                <input type="checkbox" name='size[]' value='M'>M
                <input type="checkbox" name='size[]' value='L'>L
                <input type="checkbox" name='size[]' value='XL'>XL
                <input type="checkbox" name='size[]' value='XXL'>XXL
                <input type="checkbox" name='size[]' value='XXXL'>XXXL
              
            </div>
        </div>
        
        <div class="form-group" style='margin-bottom:20px'>
          <label for="exampleInputFile"  class="col-sm-2 control-label">商品图片</label>
              <input type="file" name='path[]' id="exampleInputFile" multiple>
        </div>

        <div class="form-group " style='margin-top:30px'>
          <label for="inputEmail3" class="col-sm-2 control-label">分类标题</label>
          <div class="col-sm-10">
              <select name="cate_id" class="input w70" placeholder="选择服装分类">
                @foreach($res as $k=>$v)
                <option value="{{$v->id}}">{{$v->name}}</option>
                @endforeach
               
            </select>
          </div>
      </div>

        
        <div class="form-group" style='margin-bottom:20px'>
          <label for="inputPassword3" class="col-sm-2 control-label">状&nbsp;&nbsp;  &nbsp;&nbsp; 态</label>
          <div style='margin-top:8px '>
              <label for="nan"><input type="radio" name='status' id='nan' value='1'>上架</label> &nbsp;&nbsp; 
              <label for="nv"><input type="radio" name='status' id='nv' value='0'>下架</label>
          </div>
        </div>
        <div class="form-group" style='margin-bottom:20px'>
          <label for="inputEmail3" class="col-sm-2 control-label">商品详情</label>
          <div class="col-sm-10">
               <script id="editor" name="detail" type="text/plain" style='width:800px;height:500px'></script>
          </div>

        </div>
        <div class="mws-button-row" style='margin-left:300px'>
            {{csrf_field()}}
            <input value="添加" class="btn btn-danger" type="submit" >
            <input value="重置" class="btn " type="reset">
        </div>
    </form>
</div>
		
	</div>
<script type="text/javascript">
    var ue = UE.getEditor('editor');
</script>

@endsection